// Order.h

#pragma once

#include <string>
#include <queue>
using namespace std;

class Order
{
public:

	string instrument_id;
	double price;
	int volume;
	string datetime;

	virtual string get_type();
};

class BuyOrder : public Order
{
public:

	double profit_price;
	double stop_loss_price;

	string get_type();
};

class SellOrder : public Order
{
public:

	double profit_price;
	double stop_loss_price;

	string get_type();
};

class CloseOrder : public Order
{
public:

	int order_id;

	string get_type();
};

class OrderPool
{
private:

	static const int _SINGLE_QUEUE_SIZE;

	queue<BuyOrder*> _buy_order_queue;
	queue<SellOrder*> _sell_order_queue;
	queue<CloseOrder*> _close_order_queue;

	OrderPool();

public:

	static OrderPool* get_instance();

	BuyOrder* get_buy_order();

	SellOrder* get_sell_order();

	CloseOrder* get_close_order();

	void release_order(Order *ord);
};